package run.siyuan.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

/**
 * 委员会计费
 *
 * @author jinjingsu
 * @date 2021/03/19
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("commission_settlement")
public class CommissionSettlement extends IdIncrEntity {
    @TableId(type = IdType.AUTO)
//    @ApiModelProperty(value = "主键Id")
    @JsonSerialize(using = IdSerializer.class)
    private Long id;
    /** 创建时间 */
    @JsonIgnore
//    @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Long createTime;
    /** 修改时间 */
    @JsonIgnore
//    @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;


    // @ApiModelProperty("开始时间")
    private Long startTime;
    // @ApiModelProperty("结束时间")
    private Long endTime;
    // @ApiModelProperty("结算账单Id")
    private Long commissionBillingId;
    // @ApiModelProperty("店主Id")
    private Long memberId;
    // @ApiModelProperty("店主等级")
    private Integer storeOwnerLevel;
    // @ApiModelProperty("类型：1-平台 2-店主 3-卖家")
    private Integer type;
    // @ApiModelProperty("往期未结算金额")
    private BigDecimal openingBalance;
    // @ApiModelProperty("累计金额")
    private BigDecimal closingBalance ;
    // @ApiModelProperty("结算金额(本期结算金额+平级奖励+活动奖励+补偿金额-非正常逆项订单佣金)")
    private BigDecimal settlementAmount;
    // @ApiModelProperty("资损金额")
    private BigDecimal lossAmount;
    // @ApiModelProperty("欠款")
    private BigDecimal arrears;
    /**
     * 平级奖励
     */
    // @ApiModelProperty("平级奖励")
    private BigDecimal sliReward;
    /**
     * 活动奖励
     */
    // @ApiModelProperty("活动奖励")
    private BigDecimal campalgnRewards;
    /**
     * 往期补偿金额
     */
    // @ApiModelProperty("往期补偿金额")
    private BigDecimal pastCompensationAmount;
    /**
     * 订单完成后发起的逆向订单
     */
    // @ApiModelProperty("订单完成后发起的逆向订单")
    private BigDecimal reverseCommission;
    // @ApiModelProperty("打款金额")
    private BigDecimal paymentAmount;
    // @ApiModelProperty("本期结算金额")
    private BigDecimal amountDue;
    // @ApiModelProperty("本期账单金额")
    private BigDecimal orderAmountDue;
    // @ApiModelProperty("本期奖励账单金额")
    private BigDecimal levelUpAmountDue;
    // @ApiModelProperty("打款账号")
    private String paymentAccount;
    // @ApiModelProperty("账户名")
    private String accountName;
    // @ApiModelProperty("打款银行")
    private String paymentBank;
    // @ApiModelProperty("结算状态：1-待打款 2-已打款 6-打款中 7-打款失败")
    private Integer settlementStatus;
    // @ApiModelProperty("打款类型：1-手动打款 2-ksher 7-打款失败")
    private Integer paymentType;
    // @ApiModelProperty("打款失败原因")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String reasonFailure;
    // @ApiModelProperty(value= "交易流水号")
    private String transactionNo;
    // @ApiModelProperty("是否手动导入：0-否 1-是")
    private Boolean isImport;
    // @ApiModelProperty("备注")
    private String remark;
    // @ApiModelProperty("打款时间")
    private Long settlementTime;
    // @ApiModelProperty("是否显示")
    private Boolean isShow;
    // @ApiModelProperty("是否进入余额")
    private Boolean entryBalance;
    // @ApiModelProperty("进入余额时间")
    private Long entryBalanceTime;

    /** 逻辑删除 */
    @TableLogic
    @JsonIgnore
    // @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;
}
